package com.marktotop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.marktotop.entity.business.ReservationRecord;
import com.marktotop.error.SystemException;
import com.marktotop.response.ResultBean;
import com.marktotop.vo.business.ReservationRecordVO;
import com.marktotop.dto.SiteAndVaccDTO;
import com.marktotop.vo.business.SiteReservationVO;
import com.marktotop.vo.business.VaccineInSiteVO;

import java.text.ParseException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author MarkToTop
 * @since 2021-07-12
 */
public interface IReservationRecordService extends IService<ReservationRecord> {


    /**
     * 分页展示所有预约记录列表，并进行模糊查询
     *
     * @param pageNum
     * @param pageSize
     * @param reservationRecordVO
     * @return
     * @throws ParseException
     */
    ResultBean findReservationRecordsList(Integer pageNum, Integer pageSize, ReservationRecordVO reservationRecordVO) throws ParseException;

    /**
     * 查询某个接种点下，某个疫苗信息
     *
     * @param siteAndVaccDTO
     * @return
     */
    VaccineInSiteVO findVaccAndSite(SiteAndVaccDTO siteAndVaccDTO);


    /**
     * 预约疫苗
     *
     * @param record
     * @return
     * @throws SystemException
     */
    boolean addReservationRecords(ReservationRecord record) throws SystemException;


    /**
     * 获取单个预约点的某个疫苗预约信息
     *
     * @param id
     * @return
     * @throws SystemException
     */
    ReservationRecordVO getOneRecord(Long id) throws SystemException;


    /**
     * 取消预约信息
     *
     * @param id
     * @return
     * @throws SystemException
     */
    boolean cancelReservation(Long id) throws SystemException;


    /**
     * 受理单个预约信息（修改预约状态）
     *
     * @param id
     * @return
     * @throws SystemException
     */
    boolean acceptRecord(Long id) throws SystemException;


    /**
     * 根据预约号id，修改预约状态
     *
     * @param id
     * @param states
     * @return
     */
    boolean updateRecordStates(Long id,Integer states);


    /**
     * 根据接种点id查找该接种点所有的疫苗预约信息
     *
     * @param id
     * @return
     */
    SiteReservationVO getRecordsBySite(Long id);


    /**
     * 根据接种人id查询是否有预约记录
     *
     * @param id
     * @return
     */
    boolean haveRecordsByVaccinatorId(Long id);

}
